/**
 * 作者: wgx
 * 日期: 2024-10-15 14:05:59
 * 备注: 技能配置表
 */
package com.motu.monstercity.server.game.commondata.skill;

import io.vertx.core.json.JsonObject;

public class SkillModel {
    protected int skillId; // skill_id
    protected int skillStar; // 技能星级
    protected int effectType; // 加成类型 (1.商铺赚速百分比加成、2.power百分比加成、3.资质固定加成)
    protected int effectParam; // 加成参数
    protected int baseValue; // 初始加成值固定值
    protected int levelUpAdd; // 升级增加的固定值 (技能每升一级增加多少加成值)
    protected int baseValuePer; // 初始加成值百分比
    protected int levelUpAddPer; // 升级增加的百分比 (技能每升一级增加多少加成值百分比)
    protected int maxLevel; // 上限等级 (技能上限等级，配置0则无等级限制)
    protected String upgradeItem; // 升级所需道具id (itemid;itemid;itemid)
    protected String upgradeType; // 升级道具消耗 (level+upgrade_type从表skill_upgrade取消耗数量)
    protected int incremValue; // 升级时的递增值

    public SkillModel() {
    }

    public SkillModel(JsonObject obj) {
        skillId = obj.containsKey("skill_id") ? obj.getInteger("skill_id") : 0;
        skillStar = obj.containsKey("skill_star") ? obj.getInteger("skill_star") : 0;
        effectType = obj.containsKey("effect_type") ? obj.getInteger("effect_type") : 0;
        effectParam = obj.containsKey("effect_param") ? obj.getInteger("effect_param") : 0;
        baseValue = obj.containsKey("base_value") ? obj.getInteger("base_value") : 0;
        levelUpAdd = obj.containsKey("level_up_add") ? obj.getInteger("level_up_add") : 0;
        baseValuePer = obj.containsKey("base_value_per") ? obj.getInteger("base_value_per") : 0;
        levelUpAddPer = obj.containsKey("level_up_add_per") ? obj.getInteger("level_up_add_per") : 0;
        maxLevel = obj.containsKey("max_level") ? obj.getInteger("max_level") : 0;
        upgradeItem = obj.containsKey("upgrade_item") ? obj.getString("upgrade_item") : "";
        upgradeType = obj.containsKey("upgrade_type") ? obj.getString("upgrade_type") : "";
        incremValue = obj.containsKey("increm_value") ? obj.getInteger("increm_value") : 0;
    }

    public int getSkillId() {
        return skillId;
    }

    public int getSkillStar() {
        return skillStar;
    }

    public int getEffectType() {
        return effectType;
    }

    public int getEffectParam() {
        return effectParam;
    }

    public int getBaseValue() {
        return baseValue;
    }

    public int getLevelUpAdd() {
        return levelUpAdd;
    }

    public int getBaseValuePer() {
        return baseValuePer;
    }

    public int getLevelUpAddPer() {
        return levelUpAddPer;
    }

    public int getMaxLevel() {
        return maxLevel;
    }

    public String getUpgradeItem() {
        return upgradeItem;
    }

    public String getUpgradeType() {
        return upgradeType;
    }

    public int getIncremValue() {
        return incremValue;
    }

}
